package gravipong;


import java.awt.event.KeyEvent;

class paddle extends paintable{
	
    boolean isPlayerPaddle;
    ball bub;
    
    public paddle(boolean a){
        isPlayerPaddle = a;
        if (isPlayerPaddle == true) x = 20;
        else x = 480;
        y = 250;
    }
    
    public void move(boolean [] keys){
        if (isPlayerPaddle == false){
            if (keys[KeyEvent.VK_UP] == true){y=y-10;}
            else if (keys[KeyEvent.VK_DOWN] == true){y=y+10;}
        }
        else if (isPlayerPaddle == true){
            if (keys[KeyEvent.VK_W] == true){y=y-10;}
            else if (keys[KeyEvent.VK_S] == true){y=y+10;}
        }
    }
}